package com.coocaa.cirrus.common.third.filestore.config;

import com.qcloud.cos.COSClient;
import com.qcloud.cos.ClientConfig;
import com.qcloud.cos.auth.BasicCOSCredentials;
import com.qcloud.cos.auth.COSCredentials;
import com.qcloud.cos.http.HttpProtocol;
import com.qcloud.cos.region.Region;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author bijiahao
 * @date : 2025/7/15 16:01
 * @description
 */
//@Configuration
public class CosClientConfig {
//    @Autowired
//    private CosProperties cosProperties;
//
//    @Bean(destroyMethod = "shutdown")
//    public COSClient cosClient(CosProperties prop) {
//        COSCredentials cred = new BasicCOSCredentials(cosProperties.getAigcSecretId(), cosProperties.getAigcSecretKey());
//        ClientConfig config = new ClientConfig(new Region(cosProperties.getAigcRegionName()));
//        config.setHttpProtocol(HttpProtocol.https);
//        // 5秒连接超时
//        config.setConnectionTimeout(5000);
//        // 30秒读写超时
//        config.setSocketTimeout(30000);
//        return new COSClient(cred, config);
//    }
}
